package meijuli.com.join51.business.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import meijuli.com.join51.business.fragment.ChangeNameFragment;
import com.jhx.common.model.User;
import com.jhx.common.utils.UserManager;

/**
 * 请描述使用该类使用方法！！！
 *
 * @author wenqin 2017-07-20 19:32
 */

public class ChangeNameActivity extends BaseFragmentActivity{

    public static void start(Context context) {
        Intent intent = new Intent(context, ChangeNameActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        User user = UserManager.get().getUser();
        final ChangeNameFragment changeNameFragment = ChangeNameFragment.newInstance(user.getBusinessName());
        addFragment(changeNameFragment);
        setRightText("保存", new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                changeNameFragment.changeNameRequest();
            }
        });

    }
}
